package com.zhz.elasticjob.listener;

import com.dangdang.ddframe.job.executor.ShardingContexts;
import com.dangdang.ddframe.job.lite.api.listener.ElasticJobListener;
import lombok.extern.slf4j.Slf4j;

/**
 * @program: schedule
 * @description: elastic-job的执行前后的拦截器,
 * 这里用来提醒任务开始和结束
 * @author: zhanghz001
 * @create: 2021-08-06 08:09
 **/
@Slf4j
public class ZhzListener implements ElasticJobListener {
    @Override
    public void beforeJobExecuted(ShardingContexts shardingContexts) {
        log.info("------------" + shardingContexts.getJobName() + "----------开始-------");
    }
    
    @Override
    public void afterJobExecuted(ShardingContexts shardingContexts) {
        log.info("-------------" + shardingContexts.getJobName() + "-------------结束-------");
        
    }
}
